﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="AllianceRanking.aspx.cs"
    Inherits="smallDeimos.AllianceRanking" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Members" HeaderText="Members" ReadOnly="True" SortExpression="Members" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smallDeimosConnectionString %>"
            SelectCommand="SELECT Alliances.Name, COUNT(AllianceMembers.PlayerId) AS Members FROM Alliances INNER JOIN AllianceMembers ON Alliances.AllianceID = AllianceMembers.AllianceId GROUP BY Alliances.Name">
        </asp:SqlDataSource>
    </div>
</asp:Content>
